package com.bawei.doctor.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bawei.doctor.vo.PatientVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bawei.common.utils.PageUtils;
import com.bawei.common.utils.Query;

import com.bawei.doctor.dao.DoctorPatientMidDao;
import com.bawei.doctor.entity.DoctorPatientMidEntity;
import com.bawei.doctor.service.DoctorPatientMidService;


@Service("doctorPatientMidService")
public class DoctorPatientMidServiceImpl extends ServiceImpl<DoctorPatientMidDao, DoctorPatientMidEntity> implements DoctorPatientMidService {

    @SuppressWarnings("all")
    @Autowired
    DoctorPatientMidDao doctorPatientMidDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DoctorPatientMidEntity> page = this.page(
                new Query<DoctorPatientMidEntity>().getPage(params),
                new QueryWrapper<DoctorPatientMidEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils patientparticulars(int doctorId, int page, int size) {
        Page<PatientVo> patientVoPage = new Page<>(page, size);
       IPage<PatientVo> all=doctorPatientMidDao.patientparticulars(patientVoPage,doctorId);
        PageUtils pageUtils = new PageUtils(all);
        return pageUtils;
    }


}